﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/top.jsp"%>
<script>document.title="企业列表";</script>
<script type="text/javascript">
function getRep(pyear,ptype) {

	if (ptype==null||ptype==""){
		return ;
	}
	$.getJSON("${baseURL}/monitor/getReps?year="+pyear+"&typeId="+ptype, function(data) {
		$("#repId").empty();
		$("#repId").append( "<option value='0'>请选择..</option>" );
		//alert(data);
	 	$.each(data, function(i, item) {
            $("#repId").append( "<option value='" + item.id + "'>" + item.typeName + "</option>" );
        });
 });
}

function exportInfo() {
	
	if (!validate()){
		return;
	}
	
	searchForm.action = "${baseURL}/monitor/expReps";
	searchForm.submit();
	
}

function queryNotUnit(){
	
	if (!validate()){
		return;
	}
	searchForm.action = "${baseURL}/monitor/unrepcom";
	searchForm.submit()
}

function validate(){
	if ($("#roleId").val()==""){
		layer.alert("请选择单位类型");
		return false;
	}
	
	if ($("#createYear").val()==""){
		layer.alert("请选择报送年份");
		return false;
	}
	
	if ($("#sysId").val()==""){
		layer.alert("请选择报表制度");
		return false;
	}
	return true;
}
</script>
    <table>
	<tbody>
		<tr>
		<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png"
				align="absmiddle">&nbsp;查看未报企业</th></tr>
		<tr class="tab_grey">
		<td>
		<form name="searchForm" action="${baseURL}/monitor/unrepcom" method="get">
		    <input type="hidden" name="p" value="1" />
			<img src="${baseURL}/static/images/tab/ico.png" width="20" height="10" />单位类型
			<select id="roleId" name="roleId" style="width:105px" class="tab_textbut">
               <option value="">请选择..</option>
               <c:forEach var="role" items="${roleList}">
                   <option value="${role.id}">${role.roleName}</option>
               </c:forEach>
           </select>
			&nbsp;&nbsp;&nbsp;
			<img src="${baseURL}/static/images/tab/ico.png" width="20" height="10" />报送日期
			<input	id="createYear" name="createYear" onfocus="WdatePicker()" class="Wdate"	value="${createYear}" onchange="getRep($('#createYear').val(),$('#sysId').val());" type="text">
			
           &nbsp;&nbsp;&nbsp;
			<img src="${baseURL}/static/images/tab/ico.png" width="20" height="10" />报表制度
			<select id="sysId" name="sysId" style="width:180px"  class="tab_textbut" onchange="getRep($('#createYear').val(),$('#sysId').val());">
               <option value=0>请选择..</option>
               <c:forEach var="sys" items="${sysList}">
                   <option value="${sys.code}">${sys.codeName}</option>
               </c:forEach>
           </select>
           &nbsp;&nbsp;&nbsp;
			<img src="${baseURL}/static/images/tab/ico.png" width="20" height="10" />报表
			<select id="repId" name="repId" style="width:300px"  class="tab_textbut">
			<c:forEach var="rep" items="${repList}">
                   <option value="${rep.id}">${rep.typeName}</option>
               </c:forEach>
           </select>
           
			<a class="tab_but" href="#" onclick="queryNotUnit();return false;">查询</a>
			<a class="tab_but" href="#" onclick="clearInput();return false;">清空</a>
			<a class="tab_but02" href="#" onclick="exportInfo();return false;">导出企业信息</a>
		</form>
		<script>
		$("#roleId").val("${param['roleId']}");
		$("#createYear").val("${param['createYear']}");
		$("#repId").val("${param['repId']}");
		$("#sysId").val("${param['sysId']}");
		
		function clearInput() {
			$("#roleId").val("");
			$("#createYear").val(0);
			$("#sysId").val(0);
		}
		</script>
    </td>
    </tr>
    </tbody>
	</table>
  <br />
	<c:if test="${empty obj}">
		<b>没有符合条件的记录。</b>
	</c:if>
<c:if test="${not empty obj}">
  <table id="listTable">
	<tbody>
	<tr>
		<th width="20%">企业名称</th>
		<th width="10%">企业编号</th>
		<th width="10%">行政区划</th>
		<th width="10%">单位类型</th>
		<th width="10%">单位法人</th>
		<th width="10%">联系电话</th>
    </tr>
    <c:forEach var="oneRow" items="${obj}">		
    <tr>
		<td align="left">${oneRow.unitName}</td>
		<td align="left">${oneRow.superCompanyCode}</td>
		<td align="left">${oneRow.areaName}</td>
		<td align="left">${oneRow.roleName}</td>
		<td align="left">${oneRow.fr}</td>
		<td align="left">${oneRow.tel}</td>
    </tr>
    </c:forEach>
    
    </tbody>
  </table>
</c:if>

<%@ include file="/static/include/bottom.jsp"%>
